import type { addPropertyBillParams, enterpriseRow, propertyBillDetail, propertyData, PropertyListParams } from "@/types/property"
import { request } from "@/utils/reuqest"

// 物业费列表
export const getPropertyList = (params: PropertyListParams) => {
  return request<propertyData>('/park/propertyfee' ,'GET', params)
}

//物业费-添加账单
export const addPropertyBill = (params: addPropertyBillParams) => {
  return request('/park/propertyfee' ,'POST', params)
}

//物业费-删除账单
export const deletePropertyBill = (id: number) => {
  return request(`/park/propertyfee/${id}` ,'DELETE')
}

// 物业费-查看账单详情
export const getPropertyBillDetail = (id: number) => {
  return request<propertyBillDetail>(`/park/propertyfee/${id}` ,'GET')
}
// 查询所有企业
export const getEnterpriseList = () => {
  return request<enterpriseRow[]>('/park/all/enterprise' ,'GET')
}
// 查询所有楼宇
export const getBuildinglist = () => {
  return request<enterpriseRow[]>('/park/all/building' ,'GET')
}
// 物业费-预算金额
export const getBudgetAmount = (params: BudgetAmountParams) => {
  return request<number>('/park/propertyfee/pre/payment' ,'POST',params)
}
/**
 * empty object
 */
 interface BudgetAmountParams {
  /**
   * 楼宇id
   */
  buildingId: number;
  /**
   * 结束时间
   */
  endTime: string;
  /**
   * 开始时间
   */
  startTime: string;
}